import com.atguigu.gmall.realtime.bean.VisitorStats;

import java.lang.reflect.Field;

/**
 * @Author lzc
 * @Date 2022/4/23 10:07
 */
public class Demo3 {
    public static void main(String[] args) throws IllegalAccessException, InstantiationException, NoSuchFieldException {
        Class<VisitorStats> tClass = VisitorStats.class;
    
        VisitorStats vs = tClass.newInstance();
    
    
        Field field = tClass.getDeclaredField("stt");
        field.setAccessible(true);
        field.set(vs,"abc");
    
        System.out.println(field.get(vs));
    
    
        //        Field[] fields = tClass.getFields();
        //Field[] fields = tClass.getDeclaredFields();
        
        /*for (Field field : fields) {
            System.out.println(field.getName());
        }*/
    
        /*String fieldNames = Arrays.stream(fields).map(Field::getName).collect(Collectors.joining(","));
        System.out.println(fieldNames);*/
        
       
        
        
    
    }
}
